<template>
  <div class="newsList">
    <NewsListItem
      v-for="(item, index) in newsList"
      :key="index"
      :newsItem="item"
      @click.native="newsDetail(item)"
    ></NewsListItem>
  </div>
</template>

<script>
import NewsListItem from "./NewsListItem";

export default {
  name: "NewsList",
  components: {
    NewsListItem,
  },
  props: {
    newsList: {
      type: Array,
      default() {
        return [];
      },
    },
  },
  methods: {
    newsDetail(item) {
      this.$router.push('/detail/'+item.item_id)
    }
  },
};
</script>

<style scoped></style>
